    class pillowcse {
    static String type;
        private String color;
        private String price;

        public pillowcse(){
//            this.price = "hh";
//            this.color ="hh";
//            type = "hh";
        }

        //实例代码块 一般用来初始化元素
        {
            this.color = "hhh";
            this.price = "hhh";
        }
        {
            type = "long pillowcase";
            this.color = "red";
            this.price = "45.03";
            System.out.println("实例化代码块执行了");
        }


        //普通代码快 定义在方法中的
        public void hh(){
            System.out.println("普通代码块执行了");
        }
        //静态代码块
        static {
            //this.price = "sss";静态代码块中不能使用非静态的成员
            type = "jigntai";
            System.out.println("静态代码块执行了");
        }

        public void show() {
            System.out.println(this.color);
            System.out.println(this.price);
            System.out.println(type);
        }
    }
    public class daimakuai {
        public static void main(String[] args) {

            pillowcse hh = new pillowcse();
            hh.show();
            System.out.println(pillowcse.type);
            pillowcse hhh = new pillowcse();
            hhh.show();
            
        }

}
